{% extends BASE_TEMPLATE %}
{% load i18n transitions_tags %}

{% block bodyclass %}current-transitions{% endblock %}

{% block extrahead %}
    {{ block.super }}
    {% if are_jobs_running %}
        <meta http-equiv="refresh" content="5">
    {% endif %}
{% endblock %}

{% block view_content %}
  <div class="large-12 columns">
    <table class="full">
      <thead>
        <tr>
          <th>{% trans "Basic info" %}</th>
          <th>{% trans "Author" %}</th>
          <th>{% trans "Transition" %}</th>
          {% if for_many_objects %}
              <th>{% trans "Object" %}</th>
          {% endif %}
          <th>{% trans "Status" %}</th>
          <th>{% trans "Transition actions" %}</th>
          <th>{% trans "Data" %}</th>
          <th>{% trans "Actions" %}</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td colspan="7" class="info-header">{% trans "Current transition" %}</td>
        </tr>
        {% if jobs_in_progress %}
          {% include "transitions/_transition_jobs_table_body.html" with jobs=jobs_in_progress show_kill=True %}
        {% else %}
        <tr>
          <td colspan="7" class="empty">
            {% trans "Nothing to do." %}
          </td>
        </tr>
        {% endif %}
        {# TODO: add pagination etc #}
        <tr>
          <td colspan="7" class="info-header">{% trans "Finished transitions" %}</td>
        </tr>
        {% if jobs_ended %}
          {% include "transitions/_transition_jobs_table_body.html" with jobs=jobs_ended %}
        {% else %}
        <tr>
          <td colspan="7" class="empty">
            {% trans "Nothing to display" %}
          </td>
        </tr>
        {% endif %}
      </tbody>
    </table>
  </div>
{% endblock %}
